﻿/***************************************************************************
//* Foxit Software Inc.
//* Copyright(C) 2005-2012, all rights reserved.
//*
//* The following code is copyrighted and contains proprietary information
//* and trade secrets of Foxit Software Inc.                                                      *
***************************************************************************/

/**
* 配置管理;
*/

define(function (require, exports, module) {
    var FXREADER = require('./FXReader.js');
    /**
     * @name FXREADER.Config
     * @namespace  
	 * @description Configuration of the App.
     */
    FXREADER.Config =
    {
        language: 'en-us',

        /**
         * @description default language.
         * @type {String}
         */
        defaultLanguage: 'en-us',
        zoomList: [0.5,0.75,1.0,1.25,1.5,2.0],
        //最小放大倍数;
        minZoomSize: 0.5,
        //最大放大倍数;
        maxZoomSize: 2.0,
        //渐进式加载页面，每次能加载的最大页数，为-1表示所有页面;
        maxNewPagesPerTime: 20,
        //渐进式缩放页面，每次能缩放的最大页数，为-1表示所有页面;
        maxResizePagesPerTime: 20,
        requestRetryCount: 50,
        maxRequestRetryCount: 100,
        requestRetryInterval: 2000,
        maxManifestRetryCount: 60,
        errPageImgWidth:558,
        errPageImgHeight:106,
        /**
         * @description default zoom level(zoom level support: 0.5,1.0,1.5,2.0 and "FitWidth").
         * @type {Number} {String}
         */
        defaultZoom: 1,
        /**
         * @description The navigation panel will be display by default, if you hide the navigation panel on start, just set this value to false.
         * @type {Boolean} 
         */
        leftPanelShowOnStart: true,
        /**
         * @description The download button in the toolbar will be display by default if the document can’t be downloaded by user, 
 		 * if you want to hide the download button, just set this value to false.
         * @type {Boolean} 
         */
        showDownloadLimitBtn: true,
        /**
         * @description Following styles will be added to the viewer to disable printing when the end user does not have permission to print the PDF document.
 		 *
 		 *	<style media="print">
 		 *	body{ display:none; } 
 		 *	</style>
 		 *
 		 * If you do not want add these styles, just set this value to false.
         * @type {Boolean} 
         */
        disablePrint: true,
        MainUrl: "http://foxit.foxitcloud.com/eng/index.aspx",
        TooltipTimeout: 3000
    };

    /**
     * @name FXREADER.Config.ToolBar
 	 * @namespace
     * @description Configration of Toolbar. default configration is.
 	*<pre>	
 	*	FXREADER.Config.ToolBar =
 	*	[
 	*			{
 	*				'name': 'Logo', 'btns': ['FoxitLog'],'width':250
 	*			},
 	* 			{
 	*				'name': 'Tools', 'btns': ['HandTool', 'TextTool', 'ToolBarSeparator']
 	*			},
 	*			{
 	*				'name': 'document', 'btns': ['ToolBarSeparator', 'First Page', 'Prev Page', 'Next Page', 'Last Page', 'GotoPage', 'ToolBarSeparator']
 	*			},
 	*			{
 	*				'name': 'Zoom', 'btns': ["FitWidth","ZoomIn", "ZoomOut", "SelectZoom", 'ToolBarSeparator']
 	*			},
 	*			{
 	*				'name': 'Search', 'btns': ['SearchText', 'SearchPrev', 'SearchNext', 'ToolBarSeparator']
 	*			},
 	*			{
 	*				'name': 'DownloadPDF', 'btns': ['DownLoadPDF', 'ToolBarSeparator']
 	*			},
 	*			{
 	*				'name': 'Highlight', 'btns': ['Highlight', 'ExportData', 'ToolBarSeparator']
 	*			},
 	*			{
 	*				'name': 'DocProperties', 'btns': ['PopupDocProperties', 'ToolBarSeparator']
 	*			},
 	*	];
 	*  </pre>
    */
    FXREADER.Config.ToolBar =
    [
            {
                'name': 'Logo', 'btns': ['FoxitLog'],'width':250
            },
            {
                'name': 'Tools', 'btns': ['ToolBarSeparator', 'HandTool', 'TextTool']
            },
            {
                'name': 'document', 'btns': ['ToolBarSeparator', 'First Page', 'Prev Page', 'Next Page', 'Last Page', 'GotoPage', 'ToolBarSeparator']
            },
            {
                'name': 'Zoom', 'btns': ["FitWidth","ZoomIn", "ZoomOut", "SelectZoom", 'ToolBarSeparator']
            },
            {
                'name': 'Search', 'btns': ['SearchText', 'SearchPrev', 'SearchNext', 'ToolBarSeparator']
            },
            {
                'name': 'DownloadPDF', 'btns': ['DownLoadPDF', 'ToolBarSeparator']
            },
            {
                'name': 'Highlight', 'btns': ['Highlight', 'ExportData', 'ToolBarSeparator']
            },
            {
                'name': 'DocProperties', 'btns': ['PopupDocProperties', 'ToolBarSeparator']
            }
            ,
            {
                'name': 'CommentAnnotTool', 'btns': ['ToolBarSeparator', 'HighlightAnnot', 'UnderlineAnnot']
            }
    ];
    
    FXREADER.Config.RibbonToolBar = 
    {
    	'left': ['DownLoadPDF','ToolBarSeparator','HandTool','TextTool'],
    	'right' : ['SearchText','SearchPrev','SearchNext','QRCode']
    	/*'right' : ['SearchText','QRCode']*/
    };

    FXREADER.Config.RibbonStatusBar = 
    {
    	'center' : ['First Page', 'Prev Page','GotoPage', 'Next Page', 'Last Page'],
    	'right' : ["FitWidth","SelectZoom", "ZoomOut","ZoomSlider","ZoomIn" ]
    };
    
    /**
     * @name FXREADER.Config.MenuBar
 	 * @namespace
     * @description Configration of MenuBar. default configration is.
 	 *<pre>	
 	 *	FXREADER.Config.MenuBar =
 	 *  [
 	 *		 {
	 *           'plugin': 'document',
	 *            'items':[
	 *                { 'item': 'MenuZoom50', 'subitems': [] },
	 *                { 'item': 'MenuZoom75', 'subitems': [] },
	 *                { 'item': 'MenuZoom100', 'subitems': [] },
	 *                { 'item': 'MenuZoom125', 'subitems': [] },
	 *                { 'item': 'MenuZoom150', 'subitems': [] },
	 *                { 'item': 'MenuZoom200', 'subitems': [] },
	 *                { 'item': 'FitWidth', 'subitems': [] },
	 *                { 'item': 'MenuSeparator', 'subitems': [] },
	 *                { 'item': 'MenuPrevPage', 'subitems': [] },
	 *                { 'item': 'MenuNextPage', 'subitems': [] }
	 *            ]
	 *        },
	 *        {
	 *            'plugin': 'DocProperties',
	 *             'items':[
	 *                { 'item': 'MenuSeparator', 'subitems': [] },
	 *                { 'item': 'MenuDocProperties', 'subitems': [] }
	 *            ]
	 *        }
 	 *  ];
 	 * </pre>
     */
    FXREADER.Config.MenuBar =
    [
        {
            'plugin': 'document',
             'items':[
                 { 'item': 'MenuZoom50', 'subitems': [] },
                 { 'item': 'MenuZoom75', 'subitems': [] },
                 { 'item': 'MenuZoom100', 'subitems': [] },
                 { 'item': 'MenuZoom125', 'subitems': [] },
                 { 'item': 'MenuZoom150', 'subitems': [] },
                 { 'item': 'MenuZoom200', 'subitems': [] },
                 { 'item': 'FitWidth', 'subitems': [] },
                 { 'item': 'MenuSeparator', 'subitems': [] },
                 { 'item': 'MenuPrevPage', 'subitems': [] },
                 { 'item': 'MenuNextPage', 'subitems': [] }
             ]
         },
         {
             'plugin': 'DocProperties',
              'items':[
                 { 'item': 'MenuSeparator', 'subitems': [] },
                 { 'item': 'MenuDocProperties', 'subitems': [] }
             ]
         }
    ];

    /**
     * @name FXREADER.Config.Plugins
 	* @namespace
     * @description Configration of Plugins. default configration is.
 	*<pre>	
 	*	 FXREADER.Config.Plugins =
 	*	 {
 	*		load:{
 	*			Annot: true,
 	*			FindTool: true,
 	*			NavigationPanel: true,
 	*			Thumbnail: true,
 	*			Bookmark: true,
 	*			DocProperties: true,
 	*			ToolBar: true,
 	*			Menu: true,
 	*			Form: true,
 	*			TextSelection: true
 	*		},
 	*		flag:{
 	*			Annot: 0x0001,
 	*			FindTool: 0x0002,
 	*			NavigationPanel: 0x0004,
 	*			Thumbnail: 0x0008,
 	*			Bookmark: 0x0010,
 	*			DocProperties: 0x0020,
 	*			ToolBar: 0x0040,
 	*			Menu: 0x0080,
 	*			Form: 0x0100,
 	*			TextSelection: 0x0200
 	*		}
 	*	 };
 	*  </pre>
     */
    FXREADER.Config.Plugins =
    {
        load:{
            Annot: true,
            FindTool: true,
            NavigationPanel: true,
            Thumbnail: true,
            Bookmark: true,
            DocProperties: true,
            ToolBar: true,
            Menu: true,
            Form: true,
            TextSelection: true
        },
        flag:{
            Annot: 0x0001,
            FindTool: 0x0002,
            NavigationPanel: 0x0004,
            Thumbnail: 0x0008,
            Bookmark: 0x0010,
            DocProperties: 0x0020,
            ToolBar: 0x0040,
            Menu: 0x0080,
            Form: 0x0100,
            TextSelection: 0x0200
        }
    };

    FXREADER.Config.Url =
    {
		GetSourcePDF: "SourceDocHandler.do",
	    GetAnnotData: "DocAnnotsHandler.do",
	    GetBookmarkData: "DocBookmarksHandler.do",
	    SearchText: "SearchTextHandler.do",
	    ExportFormData: "ExportFormDataHandler.do",
	    GetFormXml: "FormXmlHandler.do",
	    GetFormWidgetBGImg: "FormWidgetBgIMGHandler.do",
	    GetPageText: "PageTextHandler.do",
	    GetBaseInfo: "DocManifest.do",
	    GetPageBGImg: "GetPageImg.do",
	    VerifyForward: 'VerifyForward.do'	,
	    QrcodeUrl : 'DocQRCode.do',
	    GetDocBin:"GetDocBin.do",
	    GetPageBin:"GetPageBin.do"
    };

    FXREADER.Config.FontUrl =
    {
    	StandFontUrl: "Editor1.0/standFont/",
    	WebFontUrl:"Editor1.0/webfont.js"
    }
    return FXREADER.Config;
});